<?php echo CHtml::scriptFile('assets/tiny_mce/tiny_mce.js'); ?>
<?php echo CHtml::scriptFile('assets/js/editor_tinymce.js'); ?>

<script type="text/javascript">
	tinymce_simple("fefooter");
</script>


<div class="content">
	<div class="content_i">
    <?php
			// Trang thai
		echo "<h2>";
			echo CHtml::image(Yii::app()->baseUrl."/assets/icon/icon-16-bulb.png");
			echo " Trạng thái Website";
		echo "</h2>";
		
        echo CHtml::beginForm(array($this->controller_id."/save"),"post", array("id"=>"form_edit"));
		
		echo "<table cellpadding='3' cellspacing='0 border='0' width='70%'>";
		
			echo "<tr>";
				echo "<td class='label' width='120'>"."Trạng thái "."</td>";
				echo "<td>";
					$list_status = array();
					$list_status[0] = " Tắt ";
					$list_status[1] = " Bật ";
					echo CHtml::dropDownList("enable", $this->website["enable"], $list_status);
					
					echo "&nbsp;&nbsp;";
					$icons =  array(
						0 => "icon-16-remove.png",
						1 => "icon-16-tick.png",
					);
					echo CHtml::link(
						CHtml::image(Yii::app()->baseUrl.'/assets/icon/'.$icons[$this->website["enable"]]),
						array(
							$this->controller_id."/enable"
						)
					);
							
				echo "</td>";
			echo "</tr>";
			
			echo "<tr>";
				echo "<td class='label' width='100'>"."Thông điệp "."</td>";
				echo "<td>";
					echo CHtml::textField("message", $this->website["message"], 
						array('style'=>'width:550px'));
				echo "</td>";
			echo "</tr>";
			
			echo "<tr>";
				echo "<td class='label' width='100'>"."Session time (phút)"."</td>";
				echo "<td>";
					echo CHtml::textField("session_time", $this->website["session_time"], 
						array('style'=>'width:550px'));
				echo "</td>";
			echo "</tr>";
			
			echo "<tr>";
				echo "<td class='label' width='100'>"."URL mở rộng"."</td>";
				echo "<td>";
					echo CHtml::textField("ext", $this->website["ext"], 
						array('style'=>'width:550px'));
				echo "</td>";
			echo "</tr>";

		echo "</table>";
		
		// Thong tin Back-end
		echo "<h2>";
			echo CHtml::image(Yii::app()->baseUrl."/assets/icon/icon-16-home.png");
			echo " Back-end";
		echo "</h2>";
		
		echo "<table cellpadding='3' cellspacing='0 border='0' width='70%'>";
			echo "<tr>";
				echo "<td class='label' width='120'>"."Tiêu đề"."</td>";
				echo "<td>";
					echo CHtml::textField("betitle", $this->website["betitle"], 
						array('style'=>'width:550px'));
				echo "</td>";
			echo "</tr>";
			
			echo "<tr>";
				echo "<td class='label' width='100'>"."Phân trang"."</td>";
				echo "<td>";
					echo CHtml::textField("beperpage", $this->website["beperpage"], 
					array('style'=>'width:550px'));
				echo "</td>";
			echo "</tr>";
		echo "</table>";
		
		// Thong tin phan Front-end
		echo "<h2>";
			echo CHtml::image(Yii::app()->baseUrl."/assets/icon/icon-16-home-b.png");
			echo " Front-end";
		echo "</h2>";
		echo "<table cellpadding='3' cellspacing='0 border='0' width='70%'>";
		
			echo "<tr>";
				echo "<td class='label' width='120'>"."Tiêu đề"."</td>";
				echo "<td>";
					echo CHtml::textField("fetitle", $this->website["fetitle"], 
						array('style'=>'width:550px'));
				echo "</td>";
			echo "</tr>";
			
			echo "<tr>";
				echo "<td class='label' width='100'>"."Phân trang"."</td>";
				echo "<td>";
					echo CHtml::textField("feperpage", $this->website["feperpage"], 
						array('style'=>'width:550px'));
				echo "</td>";
			echo "</tr>";
			
			echo "<tr>";
				echo "<td class='label' width='100'>"."Số lượt truy cập"."</td>";
				echo "<td>";
					echo CHtml::textField("no_times_visit", $this->website["no_times_visit"], 
						array('style'=>'width:550px'));
				echo "</td>";
			echo "</tr>";
			
			echo "<tr>";
				echo "<td class='label' width='100' >"."Chân trang "."</td>";
				echo "<td>";
					echo CHtml::textArea("fefooter", $this->website["fefooter"],
					 array('style'=>'width:558px; height:200px;'));
				echo "</td>";
			echo "</tr>";
			
			echo "<tr>";
				echo "<td>"."</td>";
				echo "<td>";
					echo "<div class='space_5'></div>";

					echo 
						"<div class='button' id='button_submit'>" .
							"<div style='float:left; width:20px;'>" .
								CHtml::image(Yii::app()->baseUrl."/assets/icon/icon-16-save.png") .
							"</div>" .
							"<div style='float:left; min-width:40px;font-weight:bold'>".
								"Save" .
							"</div>" .
						"</div>";
					
					echo 
						"<div class='button' id='button_cancel'>" .
							"<div style='float:left; width:20px;'>" .
								CHtml::image(Yii::app()->baseUrl."/assets/icon/icon-16-check.png") .
							"</div>" .
							"<div style='float:left; min-width:50px;font-weight:bold'>".
								"Reset" .
							"</div>" .
						"</div>";
						
				echo "</td>";
			echo "</tr>";
		echo "</table>";
		
		echo CHtml::endForm();
	?>
    </div>
</div><!-- end div right -->

<script language="javascript">
$(document).ready(function(){

	$('#button_submit').click(function(){
		$('#form_edit').submit();
	});
	
	$('#button_cancel').click(function(){
		$('#form_edit')[0].reset();
	});
	
});
</script>